package run.newbug.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import run.newbug.pojohw.User;

import java.util.List;
@Service
public interface UserMapperInter {
    List<User> getAll();
    List<User> getBySex(String sex);
    void inser(Integer id,Integer age,String name,String sex);
    void deleteById(Integer id);
    void updateSexByName(String sex,String name);

    @Select("select * from demo_user where id=#{id}")
    List<User> getById(int id);

    @Insert("insert into demo_user(id,name,age,sex) values(#{id},#{name},#{age},#{sex})")
    void inser2(User user);
}
